﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mForum.Web.Common.ViewDataModel
{
    using mForum.Core.Common;
    using mForum.Core.Infrastructure.Settings;

    public class ViewDataFactory : IViewDataFactory
    {
        protected Settings _settings;

        public ViewDataFactory(Settings settings)
        {
            Check.Argument.IsNotNull(settings, "settings");

            _settings = settings;
        }

        public T Create<T>() where T : BaseViewData, new()
        {
            T viewData = new T
            {
                SiteTitle = _settings.SiteTitle,
                MetaKeywords = _settings.MetaKeywords,
                MetaDescription = _settings.MetaDescription
            };

            return viewData;
        }
    }
}
